home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: Why doesn't this work?
- Date: 05 Mar 1996 03:35:21 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Mar4203521@qcd.lanl.gov>
- References: <1996Mar4.161412.137442@forest>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: ebromber@forest.drew.edu's message of 4 Mar 96 16:14:12 EST
-
- In article <1996Mar4.161412.137442@forest>
- ebromber@forest.drew.edu writes:
-
- e: Does anyone know why this password program doesn't work properly? And if
- e: you do know the problem how can I fix it? It rejects every password
- including
- e: the real password. The program was compiled using a MS-DOS compiler.
- e: main();
- e: { char real[4];
-
- If you know something will not change you can declare it const. If you
- replace this with `const char real[4]="jerk";', you will find your
- error :-) Of course, your method is probably better: make the program
- slightly more secure by scattering the ints all over.
-
- <snip>
- e: real[0]='j';real[1]='e';real[2]='r';real[3]='k';
- <snip>
- e: for (i=0; i<4; i++)
- e: if (real[i]=pass[i]) error++;
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-